



<div class="select-box layui-form">
    <form action="detail-statistic.php" >

        <input type="hidden" name ="nid"  value="<? echo $_REQUEST['nid']?>"/>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <select name="select_status">
                    <?if($_REQUEST['select_status']){echo "<option value='".$_REQUEST['select_status']."'>".$_REQUEST['select_status']."</option>";}?>
                    <option value="全部">全部</option>
                    <option value="完成">已完成</option>
                    <option value="进行中">进行中</option>
                </select>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">时间</label>
            <div class="layui-input-block">
                <input type="text" name="select_ontime" placeholder="请输入时间节点" autocomplete="off" class="layui-input"
                       onclick="laydate({istime: true, format: 'YYYY'})" style="float: left; width: 112px"
                       value="<?if($_REQUEST['select_ontime']){echo $_REQUEST['select_ontime'] ;} ?>" >
            </div>
        </div>



        <button class="layui-btn" ><i class="layui-icon">&#xe615;</i> 查找</button>
        <a class="layui-btn" href="<?echo $domain?>/controlbase/unit/detail-list.php?sys_part=unit" ><i class="layui-icon">&#x1006;</i> 重置</a>

        <br class="clearfloat"/>
    </form>

    <br class="clearfloat"/>
</div>




<?
if($_REQUEST['select_ontime']=="")
{
    $ontime="";
}
else
{
    $ontime=" and startdate like '%".$_REQUEST['select_ontime']."%' ";
}




if($_REQUEST['select_status']=="全部" or $_REQUEST['select_status']=="")    {$status = " and (status ='进行中' or status = '完成')";}
if($_REQUEST['select_status']=="进行中")   { $status = " and status ='进行中'";}
if($_REQUEST['select_status']=="完成")    { $status = " and status ='完成'";}



$case_list=select_lines_all_items($table_Prefix."case",
                                " nid desc",
                              "sales = '".$_REQUEST['nid']."'".$status.$ontime  ,
                                "");
?>

<table class="layui-table">
    <colgroup>
        <col >
        <col >
        <col >
        <col >
        <col >


        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>项目名称</th>
        <th>开始日期</th>
        <th>结算日期</th>
        <th>所属单位</th>
        <th>金额</th>
        <th>状态</th>
    </tr>
    </thead>
    <tbody>

    <tr>
        <th> </th>
        <th> </th>
        <th> </th>
        <th> </th>
        <th> </th>
        <th>合计 <?echo sum_with_key_in_2d_array($case_list,"sum")?></th>
        <th> </th>
    </tr>


<?foreach ($case_list as $k=>$v){?>
        <tr>
            <td><? echo $k?></td>
            <td><? echo $v['name']?></td>
            <td><? echo $v['startdate']?></td>
            <td><? echo $v['enddate'] ?></td>
            <td><? echo $v['unit']?></td>
            <td><? echo $v['sum']?></td>
            <td><? echo $v['status']?></td>
        </tr>
<?}?>
    </tbody>
</table>

